import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Tabs } from 'antd';
var TabPane = Tabs.TabPane;

var generateId = function () {
  var i = 0;
  return function () {
    var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
    i += 1;
    return "".concat(prefix).concat(i);
  };
}();

var LoginTab = /*#__PURE__*/function (_Component) {
  _inherits(LoginTab, _Component);

  var _super = _createSuper(LoginTab);

  function LoginTab(props) {
    var _this;

    _classCallCheck(this, LoginTab);

    _this = _super.call(this, props);
    _this.uniqueId = generateId('login-tab-');
    return _this;
  } //  eslint-disable-next-line


  _createClass(LoginTab, [{
    key: "UNSAFE_componentWillMount",
    value: function UNSAFE_componentWillMount() {
      if (this.context.tabUtil) {
        this.context.tabUtil.addTab(this.uniqueId);
      }
    }
  }, {
    key: "render",
    value: function render() {
      return /*#__PURE__*/React.createElement(TabPane, this.props);
    }
  }]);

  return LoginTab;
}(Component);

LoginTab.__ANT_PRO_LOGIN_TAB = true;
LoginTab.contextTypes = {
  tabUtil: PropTypes.object
};
export { LoginTab as default };